package xyz.zhengtank.grpc.service;

import io.grpc.stub.StreamObserver;
import xyz.zhengtank.grpc.HelloProto.HelloReply;
import xyz.zhengtank.grpc.HelloProto.HelloRequest;
import xyz.zhengtank.grpc.HelloProtoServiceGrpc;
/**
 * proto定义的业务实现类
 * @author tank
 * @since 2018-03-30
 * @category 
 *
 */
public class HelloProtoServiceImpl extends HelloProtoServiceGrpc.HelloProtoServiceImplBase{

	@Override
	public void sayHello(HelloRequest request, StreamObserver<HelloReply> responseObserver) {
		//根据request设置response
		HelloReply reply = HelloReply.newBuilder().setReply("hello"+request.getName()).build();
		responseObserver.onNext(reply);
		responseObserver.onCompleted();
		
	}
	
	

}
